﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using Microsoft.SharePoint;
using ProjectHT.YKDGVB2012.Core.Datacontract;

namespace ProjectHT.YKDGVB2012.Core.UserControls
{
    public class ViewToanvan : System.Web.UI.UserControl
    {

        private IMainList _mainlist;

        protected ViewToanvan()
        {
            var services = new MainServices(SPContext.Current);
            _mainlist = services;
        }

        
        protected Label LinkGopy;
        protected void Page_Load(object sender,EventArgs e)
        {
            var ids = string.Format("{0}", Context.Request.Params[Helper.Constans.ITEMID]);
            if (!string.IsNullOrEmpty(ids))
            {
                LinkGopy.Text = "<a href='/Pages/Comment/Gopy.aspx?ids=" + ids + "'>Gửi góp ý<a>";
            }
        }


        protected string LoadContentbox()
        {
            var str = string.Empty;

            var ids = string.Format("{0}", Context.Request.Params[Helper.Constans.ITEMID]);
            if (!string.IsNullOrEmpty(ids))
            {
                var maindoc = _mainlist.GetbyId(Convert.ToInt32(ids));
                if (maindoc != null)
                {
                    str = string.Format("{0}", maindoc[Common.MainList.FIELDFULLCONTENT]);
                }

            }
            return str;
        }
    }
}
